#include<bits/stdc++.h>
using namespace std;
int n,m,mp[105][105],t[3];
string s;
bool in(int x,int y)
{
    return x>0 && y>0 && x<=n && y<=m;
}
int num(int x,int y)
{
    t[0]=t[1]=t[2]=0;
    if(in(x-1,y)==1 && mp[x-1][y]!=-1) t[mp[x-1][y]]=1;
    if(in(x+1,y)==1 && mp[x+1][y]!=-1) t[mp[x+1][y]]=1;
    if(in(x,y-1)==1 && mp[x][y-1]!=-1) t[mp[x][y-1]]=1;
    if(in(x,y+1)==1 && mp[x][y+1]!=-1) t[mp[x][y+1]]=1;
    return t[0]+t[1]+t[2];
}
int a[(int)(1e6+5)],dir[4][2]={{1,0},{0,1},{-1,0},{0,-1}};
char ans[(int)(1e6+5)],prt[4]={'D','R','U','L'};
int cal(int x,int y)
{
    return min(min(x,y),min(n-x+1,m-y+1));
}
int x,y,px,py;
bool solve()
{
    srand(time(0));
    mt19937 rnd(rand());
    memset(mp,-1,sizeof(mp));
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=m;j++)
        {
            mp[i][j]=rnd()%3;
            while((i-1>1 && j>1 && j<m && num(i-1,j)<3) || (j-1>1 && i>1 && num(i,j-1)<2)) mp[i][j]=rnd()%3;
        }
    }
    x=y=0;
    for(int i=1;i<=n;i++)
        for(int j=1;j<=m;j++)
            if(mp[i][j]==a[0] && cal(i,j)>cal(x,y)) x=i,y=j;
    px=x,py=y;
    int k;
    for(int i=1;i<s.size();i++)
    {
        k=-1;
        for(int j=0;j<4;j++)
        {
            if(in(x+dir[j][0],y+dir[j][1])==0 || mp[x+dir[j][0]][y+dir[j][1]]!=a[i]) continue;
            if(k==-1 || cal(x+dir[j][0],y+dir[j][1])>cal(x+dir[k][0],y+dir[k][1])) k=j;
        }
        if(k==-1) return 0;
        ans[i]=prt[k];
        x+=dir[k][0],y+=dir[k][1];
    }
    return 1;
}
int main()
{
    freopen("snake.in","r",stdin);
    freopen("snake.out","w",stdout);
    ios::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    cin>>s;
    for(int i=0;i<s.size();i++)
    {
        if(s[i]=='R') a[i]=0;
        if(s[i]=='G') a[i]=1;
        if(s[i]=='B') a[i]=2;
    }
    n=m=70;
    while(1)
    {
        if(solve()==1) break;
    }
    cout<<n<<' '<<m<<'\n';
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=m;j++)
        {
            if(mp[i][j]==0) cout<<'R';
            if(mp[i][j]==1) cout<<'G';
            if(mp[i][j]==2) cout<<'B';
        }
        cout<<'\n';
    }
    cout<<px<<' '<<py<<'\n';
    for(int i=1;i<s.size();i++) cout<<ans[i];
    cout<<'\n';
    return 0;
}
